﻿Chenxin.UI.ShowCommunityLogs = Chenxin.extend(Chenxin.UI.PageCommon, {
    autoInitForm: false,
    actionUrl: '/service/ShowCommunityLogs.ashx',
    createSearch: function() {
        return new Chenxin.UI.ShowCommunityLogsSearch({
            scope: this
        });
    },
    createGrid: function() {
        return new Chenxin.UI.JsonGrid({
            actionUrl: this.actionUrl + '?op=search',
            id: 'communitylogs_table',
            renderTo: 'communitylogs_table',
            modelId:'RecordId',
            hasCheckBox: false,
            cellAlign:'left',	
            cellBorder: true,
            height: 400,
            pageSize:50,
            scope: this,
            columns: {
                RecordId: {
                    create: false,
                    head: 'id'
                },
                CityName: {
                    head: '城市',
                    width: 80
                },
                CompanyName: {
                    head: '公司',
                    width: 100
                },
                DepartName: {
                    head: '部门',
                    width: 100
                },
                UserName: {
                    head: '人员',
                    width: 70
                },
                OprType: {
                    head: '类型',
                    width: 70
                },
                Addtime: {
                    head: '时间',
                    width: 70
                },
                OperationContext: {
                    head: '内容',
                    width: 3500,
                    style: "text-align:left"
                }
            }
        });
    },
    initEvent: function() {
        var _this = this;
        /*************************事件：起始日期得到焦点************************/
        $("#DateFr").focus(function() {
            WdatePicker({ dateFmt: 'yyyy-MM-dd', oncleared: function() { $(this).blur(); }, onpicked: function() { $(this).blur(); } })
        });
        /*************************事件：终止日期得到焦点************************/
        $("#DateTo").focus(function() {
            WdatePicker({ dateFmt: 'yyyy-MM-dd', oncleared: function() { $(this).blur(); }, onpicked: function() { $(this).blur(); } })
        });
    },
    initComponent: function() {
        Chenxin.UI.ShowCommunityLogs.superclass.initComponent.call(this);
    }
});

/**
*查询面板
*/
Chenxin.UI.ShowCommunityLogsSearch=Chenxin.extend(Chenxin.UI.SearchCommon,{
    id:'CommunityLogs_search',
    initEvent:function(){
        var _this=this; 
        //查询按钮
        $('#btSreachLogs').click(function(){
            _this.scope.reloadGrid();
        });
        $('#DateFr').defText({
            deftxt: '请选择时间'
        });
        $('#DateTo').defText({
            deftxt: '请选择时间'
        });
    },
    createComboList: function() {
        //五级联Combo
        var combl = new Chenxin.UI.StructComboList();
        var structs = combl.comboList;
        //类型
        var ComboStatus = new Chenxin.UI.Combo({
            containerId: '#OprType',
            tbxWidth: 50,
            colWidth: 50,
            items: comboCommon.CommunityOprType
        });
        structs.push(ComboStatus);
        return structs;
    },
    initComponent: function() {
        Chenxin.UI.ShowCommunityLogsSearch.superclass.initComponent.call(this);
    }
});

getcity = true; //设置需要获取城市下拉框数据

$(document).ready(function(){
    var showcommunitylogs = new Chenxin.UI.ShowCommunityLogs();
});